import cv2

# 读取图像
image = cv2.imread('example.jpg')

# 定义缩放后的宽度和高度
width = 800
height = 600

# 缩放图像
resized_image = cv2.resize(image, (width, height))

# 保存缩放后的图像
cv2.imwrite('resized_image.jpg', resized_image)